package com.lyx.exercise_io;

import java.io.File;

public class Exercise02 {
    public static void main(String[] args) {
        System.out.println(checkFile("c:\\developer\\myTest.txt"));
        File file = new File("c:\\developer\\myTest.txt");
        if(file.exists()){
            System.out.println(file.length());
        }

    }
    private static long checkFile(String fileName){
        File file = new File(fileName);
        if(!file.exists()){
            return 0;
        }
        return file.length();
    }
}
